package com.college.heyuhua.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.resource.VersionResourceResolver;

/**
 * Created by 赵东坡 on 2018/4/26.
 * Time:7:47
 * 宇宙无敌赵牛逼，祈求永无bug
 */
@Configuration
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").
                addResourceLocations("classpath:/static/").
                resourceChain(true).
                addResolver(new VersionResourceResolver().
                        addFixedVersionStrategy("1.10", "/**/*.js").
                        addContentVersionStrategy("/**"));
    }
}